<template>
    <div>
      <h2>{{ activity.title }}</h2>
      <p>描述: {{ activity.description }}</p>
      <p>日期: {{ activity.date }}</p>
      <p>地点: {{ activity.location }}</p>
    </div>
  </template>
  
  <script setup>
  import { computed } from 'vue'
  import { useRoute } from 'vue-router'
  import activities from '@/data/activities.js'
  
  const route = useRoute()
  const activity = computed(() => activities.find(a => a.id === parseInt(route.params.id)))
  </script>